package com;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author wbzs,
 * @date 2022/10/20,
 * @time 16:01,
 */

@SpringBootApplication
@EnableEurekaClient
public class eurekaStarer05 {

    public static void main(String[] args) {
        SpringApplication.run(eurekaStarer05.class, args);
    }

    //发起网络请求的工具类
    @LoadBalanced//开启负载均衡，也就是从注册中心里面获取到地址后进行负载均衡
    @Bean
    public RestTemplate restTemplate(){
        return  new RestTemplate();
    }
}
